<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class CollectGoodCommand extends Command {
	/**
	 * The name and signature of the console command.
	 *
	 * @var string
	 */
	protected $signature = 'command:name';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Command description';

	/**
	 * Create a new command instance.
	 *
	 * @return void
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function handle() {
		$url = "http://search.kongfz.com/product_result/?status=0&pubdate=201910h201911&price=100.00h200.00&pagenum=1&ajaxdata=1&type=1&ajaxdata=2&_=1574995422618";
		$data = GraspService::goodList($url);
		$totalPage = ceil($data['total'] / $data['pagecount']);
		for ($i = 2; $i <= $totalPage; $i++) {
			$ret = GraspService::goodList($url);
			if (!$ret) {
				continue;
			}
		}
	}

}
